(()=>{function t(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var c=Object.getOwnPropertySymbols(t);e&&(c=c.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),n.push.apply(n,c)}return n}function e(e){for(var c=1;c1025?"no":"yes");var i={};function _(){localStorage.getItem("ht_ctc_storage")&&(i=localStorage.getItem("ht_ctc_storage"),i=JSON.parse(i))}function s(t){return!!i[t]&&i[t]}function u(t,e){_(),i[t]=e;var n=JSON.stringify(i);localStorage.setItem("ht_ctc_storage",n)}_();var l={},d={};function h(){var t=document.querySelector(".ht_ctc_chat_data");t&&t.remove(),document.dispatchEvent(new CustomEvent("ht_ctc_event_settings",{detail:{ctc:l}})),function(){if(r){document.dispatchEvent(new CustomEvent("ht_ctc_event_chat")),function(t){l.schedule&&"yes"==l.schedule?document.dispatchEvent(new CustomEvent("ht_ctc_event_display",{detail:{ctc:l,display_chat:g,ht_ctc_chat:t,online_content:b}})):(g(t),b())}(r),r.addEventListener("click",function(){document.querySelector(".ht_ctc_chat_greetings_box")||S(r)}),function(){if(r){var t=document.querySelector(".ht_ctc_chat_greetings_box");t&&r.addEventListener("click",function(e){e.target.closest(".ht_ctc_chat_style")&&(t.classList.contains("ctc_greetings_opened")?p("user_closed"):v("user_opened"))}),r.addEventListener("click",function(t){t.target.closest(".ctc_greetings_close_btn")&&p("user_closed")})}}(),r&&r.addEventListener("click",function(t){if(t.target.closest(".ht_ctc_chat_greetings_box_link")){t.preventDefault();var e=document.querySelector("#ctc_opt");if(e)if(e.checked||s("g_optin"))S(r),m();else{var n=document.querySelector(".ctc_opt_in");n&&(n.style.display="block",n.style.opacity="0",setTimeout(function(){n.style.transition="opacity 0.4s",n.style.opacity="1"},10))}else S(r),m();document.dispatchEvent(new CustomEvent("ht_ctc_event_greetings"))}});var t=document.querySelector("#ctc_opt");t&&t.addEventListener("change",function(){if(t.checked){var e=document.querySelector(".ctc_opt_in");e&&(e.style.transition="opacity 0.1s ease-out",e.style.opacity="0",setTimeout(function(){e.style.display="none"},100)),u("g_optin","y"),setTimeout(function(){S(r),m()},500)}})}}(),o(document).on("click",".ht-ctc-sc-chat",function(){S(this)}),document.addEventListener("click",function(t){var e=t.target.closest(".ctc_chat, #ctc_chat");e&&(S(e),e.classList.contains("ctc_woo_place")&&t.preventDefault());var n=t.target.closest('[href="#ctc_chat"]');n&&(t.preventDefault(),S(n))})}function v(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"open";w();var e=document.querySelector(".ht-ctc-chat .ctc_cta_stick");e&&e.remove();var n=document.querySelector(".ht_ctc_chat_greetings_box");n&&("init"==t?o(".ht_ctc_chat_greetings_box").show(70):o(".ht_ctc_chat_greetings_box").show(400),n.classList.add("ctc_greetings_opened"),n.classList.remove("ctc_greetings_closed")),u("g_action",t),"user_opened"==t&&u("g_user_action",t),function(){if(document.querySelector(".ctc_greetings_modal")&&!document.querySelector(".ht_ctc_modal_backdrop")){var t=function(e){"Escape"===e.key&&(p("user_closed"),document.removeEventListener("keydown",t))},e=document.createElement("div");e.className="ht_ctc_modal_backdrop",document.body.appendChild(e),e.addEventListener("click",function(){p("user_closed")}),document.addEventListener("keydown",t)}}()}function m(){f(),setTimeout(function(){p("chat_clicked")},500)}function p(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"close";f(),"element"==t?o(".ht_ctc_chat_greetings_box").hide(70):o(".ht_ctc_chat_greetings_box").hide(400);var e=document.querySelector(".ht_ctc_chat_greetings_box");e&&(e.classList.add("ctc_greetings_closed"),e.classList.remove("ctc_greetings_opened")),u("g_action",t),"user_closed"==t&&u("g_user_action",t)}function f(){var t=document.querySelector(".ht_ctc_modal_backdrop");t&&t.remove()}function g(t){var e;"yes"==a?"show"==l.dis_m&&((e=document.querySelector(".ht_ctc_desktop_chat"))&&e.remove(),t.style.cssText=l.pos_m+l.css,y(t)):"show"==l.dis_d&&((e=document.querySelector(".ht_ctc_mobile_chat"))&&e.remove(),t.style.cssText=l.pos_d+l.css,y(t))}function y(t){try{o(t).show(parseInt(l.se))}catch(e){t.style.display="block"}!function(){var t=document.querySelector(".ht_ctc_chat_greetings_box");if(t){if(l.g_device){if("yes"!==a&&"mobile"===l.g_device)return void t.remove();if("yes"===a&&"desktop"===l.g_device)return void t.remove()}document.dispatchEvent(new CustomEvent("ht_ctc_event_after_chat_displayed",{detail:{ctc:l,greetings_open:v,greetings_close:p}})),l.g_init&&"user_closed"!==s("g_user_action")&&("default"===l.g_init?"yes"!==a&&v("init"):"open"===l.g_init&&v("init"));var e=document.querySelectorAll('.ctc_greetings, #ctc_greetings, .ctc_greetings_now, [href="#ctc_greetings"]');e.length>0&&e.forEach(function(t){t.addEventListener("click",function(t){t.preventDefault(),p("element"),v("element")})})}}(),function(){if(document.querySelector(".ht_ctc_notification")&&"stop"!==s("n_badge")){var t=document.querySelector(".ctc_nb");if(t){var e=t.closest(".ht_ctc_style"),n=document.querySelector(".ht_ctc_badge");if(e&&n){var c,a,r=null===(c=e.querySelector(".ctc_nb"))||void 0===c?void 0:c.getAttribute("data-nb_top"),i=null===(a=e.querySelector(".ctc_nb"))||void 0===a?void 0:a.getAttribute("data-nb_right");null!==r&&(n.style.top=r),null!==i&&(n.style.right=i)}}var _=l.n_time?1e3*l.n_time:150;setTimeout(function(){o(".ht_ctc_notification").show(400)},_)}}(),function(t){var e=t.classList.contains("ht_ctc_entry_animation")?1200:120;setTimeout(function(){t.classList.add("ht_ctc_animation",l.ani)},e),o(".ht-ctc-chat").hover(function(){o(".ht-ctc-chat .ht-ctc-cta-hover").show(120)},function(){o(".ht-ctc-chat .ht-ctc-cta-hover").hide(100)})}(t)}function b(){document.querySelector(".for_greetings_header_image_badge")&&(document.querySelectorAll(".for_greetings_header_image_badge").forEach(function(t){t.classList.add("g_header_badge_online")}),o(".for_greetings_header_image_badge").show())}function w(){var t=document.querySelector(".ht_ctc_notification");t&&(u("n_badge","stop"),t.remove())}function k(o){if(l.analytics&&"session"==l.analytics){if(sessionStorage.getItem("ht_ctc_analytics"))return;sessionStorage.setItem("ht_ctc_analytics","done")}function a(e){var c=l.chat_number&&""!==l.chat_number?l.chat_number:l.number;try{document.dispatchEvent(new CustomEvent("ht_ctc_event_apply_variables",{detail:{v:e}})),e=(e=(e=(e=void 0!==window.apply_variables_value?window.apply_variables_value:e).replace("{number}",c)).replace("{title}",n)).replace("{url}",t)}catch(t){}return e}var r;r="event_"+Math.floor(1e4+9e4*Math.random()),l.ctc_pixel_event_id=r,document.dispatchEvent(new CustomEvent("ht_ctc_event_analytics"));var i=l.chat_number&&""!==l.chat_number?l.chat_number:l.number,_={},s="Click to Chat for WhatsApp",u="chat: "+i,h=n+", "+t;if(l.ga){var v=l.g_an_event_name&&""!==l.g_an_event_name?l.g_an_event_name:"click to chat";v=a(v),d.g_an_params&&d.g_an_params.forEach(function(t){if(d[t]){var e=d[t],n=e.key,c=e.value;n=a(n),c=a(c),_[n]=c}});var m=0,p="no",f=[];if("undefined"!=typeof dataLayer)try{var g=function(t,e){t&&"string"==typeof t&&""!==t.trim()&&(f.includes(t)||f.push(t))};"undefined"==typeof gtag&&(window.gtag=function(){dataLayer.push(arguments)},p="yes");var y=[];try{var b,w=null===(b=window.google_tag_data)||void 0===b?void 0:b.tidr;null!=w&&w.destination&&"object"===c(w.destination)&&Object.keys(w.destination).forEach(function(t){g(t)})}catch(t){}try{var k,S=null===(k=window.google_tag_data)||void 0===k||null===(k=k.tidr)||void 0===k?void 0:k.container;S&&"object"===c(S)&&Object.values(S).forEach(function(t){Array.isArray(t.destinations)&&t.destinations.forEach(function(t){"string"==typeof t&&t.startsWith("G-")&&g(t)})})}catch(t){}try{Array.isArray(window.dataLayer)&&window.dataLayer.forEach(function(t){Array.isArray(t)&&"config"===t[0]&&"string"==typeof t[1]?g(t[1]):null!=t&&t.send_to&&"string"==typeof t.send_to&&g(t.send_to)})}catch(t){}f.forEach(function(t){var e;e=(e=t).toUpperCase(),y.includes(e)||(y.push(e),(e.startsWith("G-")||e.startsWith("GT-"))&&(_.send_to=e,gtag("event",v,_),m++))})}catch(t){}0==m&&"no"==p&&("undefined"!=typeof gtag?gtag("event",v,_):"undefined"!=typeof ga&&void 0!==ga.getAll?ga.getAll()[0].send("event",s,u,h):"undefined"!=typeof __gaTracker&&__gaTracker("send","event",s,u,h))}if("undefined"!=typeof dataLayer){dataLayer.push({event:"Click to Chat",type:"chat",number:i,title:n,url:t,event_category:s,event_label:h,event_action:u,ref:"dataLayer push"});var E=e(e({},null!=_?_:{}),{},{event:null!=v?v:"chat_click",ref:"dataLayer push ga admin values"});dataLayer.push(E)}if(l.ads&&"undefined"!=typeof gtag_report_conversion&>ag_report_conversion(),l.fb&&"undefined"!=typeof fbq){var x=l.pixel_event_name&&""!==l.pixel_event_name?l.pixel_event_name:"Click to Chat by HoliThemes",q=d.pixel_event_type&&""!==d.pixel_event_type?d.pixel_event_type:"trackCustom",O={};d.pixel_params&&d.pixel_params.forEach(function(t){if(d[t]){var e=d[t],n=e.key,c=e.value;n=a(n),c=a(c),O[n]=c}}),l.ctc_pixel_event_id="",fbq(q,x,O,{eventID:r})}}function S(t){document.dispatchEvent(new CustomEvent("ht_ctc_event_number",{detail:{ctc:l}}));var e=l.number,n=l.pre_filled;if(t.hasAttribute("data-number")&&""!==t.getAttribute("data-number")&&(e=t.getAttribute("data-number")),t.hasAttribute("data-pre_filled")){var c=t.getAttribute("data-pre_filled")||"";n=(l.prefix_pre_filled?l.prefix_pre_filled:"")+c}try{n=n.replaceAll("%","%25");var r=window.location.href;n=n.replace(/\[url]/gi,r),n=encodeURIComponent(decodeURI(n))}catch(t){}if(""!=e||l.custom_url_m&&""!==l.custom_url_m||l.custom_url_d&&""!==l.custom_url_d){var i="https://wa.me/"+e+"?text="+n,_=l.url_target_d?l.url_target_d:"_blank";"yes"==a?(l.url_structure_m&&"wa_colon"==l.url_structure_m&&(i="whatsapp://send?phone="+e+"&text="+n,_="_self"),l.custom_url_m&&""!==l.custom_url_m&&(i=l.custom_url_m)):(l.url_structure_d&&"web"==l.url_structure_d&&(i="https://web.whatsapp.com/send?phone="+e+"&text="+n),l.custom_url_d&&""!==l.custom_url_d&&(i=l.custom_url_d));var s="popup"==_?"scrollbars=no,resizable=no,status=no,location=no,toolbar=no,menubar=no,width=788,height=514,left=100,top=100":"noopener";window.open(i,_,s),l.chat_number=e,k(),function(t){if(l.hook_url){var e={};if(l.hook_v){e=void 0!==E?E:l.hook_v;var n={},c=1;e.forEach(function(t){n["value"+c]=t,c++}),l.hook_v=n}document.dispatchEvent(new CustomEvent("ht_ctc_event_hook",{detail:{ctc:l,number:t}}));var a=l.hook_url;if(e=l.hook_v,l.webhook_format&&"json"==l.webhook_format)var r=e;else r=JSON.stringify(e);o.ajax({url:a,type:"POST",mode:"no-cors",data:r,success:function(t){}})}}(e),w()}else if(l.no_number){var u=document.querySelector(".ctc-no-number-message");u&&(u.style.display="block")}}"undefined"!=typeof ht_ctc_chat_var&&(l=ht_ctc_chat_var),"undefined"!=typeof ht_ctc_variables&&(d=ht_ctc_variables),0===Object.keys(l).length||0===Object.keys(d).length?function(){if(0===Object.keys(l).length&&document.querySelector(".ht_ctc_chat_data"))try{var t,e=(null===(t=document.querySelector(".ht_ctc_chat_data"))||void 0===t?void 0:t.getAttribute("data-settings"))||"";l=JSON.parse(e),window.ht_ctc_chat_var=l}catch(t){}0===Object.keys(d).length&&(d={g_an_event_name:"click to chat",pixel_event_name:"Click to Chat by HoliThemes",pixel_event_type:"trackCustom",g_an_params:["g_an_param_1","g_an_param_2","g_an_param_3"],g_an_param_1:{key:"number",value:"{number}"},g_an_param_2:{key:"title",value:"{title}"},g_an_param_3:{key:"url",value:"{url}"},pixel_params:["pixel_param_1","pixel_param_2","pixel_param_3","pixel_param_4"],pixel_param_1:{key:"Category",value:"Click to Chat for WhatsApp"},pixel_param_2:{key:"return_type",value:"chat"},pixel_param_3:{key:"ID",value:"{number}"},pixel_param_4:{key:"Title",value:"{title}"}},window.ht_ctc_variables=d),h()}():h();var E=l.hook_v?l.hook_v:""})})()